-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Store information about each proxy in ModuleExtensionUsage #22307
Conversation
The current ModuleExtensionUsage class was designed in the days before we allowed multiple `use_extension` calls for the same extension in the same module. This PR brings the class up to speed to better reflect the actual API. This will also lay the groundwork for `bazel mod tidy` working with `include()`d segments. Work towards #22063
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much nicer!
src/main/java/com/google/devtools/build/lib/bazel/bzlmod/ModuleThreadContext.java
Outdated
Show resolved
Hide resolved
@@ -445,13 +445,14 @@ public static RootModuleFileValue evaluateRootModuleFile( | |||
throw errorf(Code.BAD_MODULE, "error executing MODULE.bazel file for the root module"); | |||
} | |||
for (ModuleExtensionUsage usage : module.getExtensionUsages()) { | |||
if (usage.getIsolationKey().isPresent() && usage.getImports().isEmpty()) { | |||
ModuleExtensionUsage.Proxy firstProxy = usage.getProxies().getFirst(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe move this into the if
and rename to onlyProxy
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the if
itself contains a reference to firstProxy
.
The current ModuleExtensionUsage class was designed in the days before we allowed multiple `use_extension` calls for the same extension in the same module. This PR brings the class up to speed to better reflect the actual API. This will also lay the groundwork for `bazel mod tidy` working with `include()`d segments. Work towards bazelbuild#22063 Closes bazelbuild#22307. PiperOrigin-RevId: 632377764 Change-Id: I282a68bc7962088ae4583418f73b2e60a0ec88f0
The current ModuleExtensionUsage class was designed in the days before we allowed multiple `use_extension` calls for the same extension in the same module. This PR brings the class up to speed to better reflect the actual API. This will also lay the groundwork for `bazel mod tidy` working with `include()`d segments. Work towards #22063 Closes #22307. PiperOrigin-RevId: 632377764 Change-Id: I282a68bc7962088ae4583418f73b2e60a0ec88f0
The current ModuleExtensionUsage class was designed in the days before we allowed multiple
use_extension
calls for the same extension in the same module. This PR brings the class up to speed to better reflect the actual API.This will also lay the groundwork for
bazel mod tidy
working withinclude()
d segments.Work towards #22063